﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using FytSoa.Application.Authorize;
using FytSoa.Application.Sys;
using FytSoa.Builder;
using FytSoa.Common;
using FytSoa.Model.Sys;
using Microsoft.AspNetCore.Mvc;

namespace FytSoa.Api.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class WeatherForecastController : ControllerBase
    {
        private readonly ISysAdminService _adminService;
        private readonly IBuilderTool _toolService;
        public WeatherForecastController(ISysAdminService adminService
            , IBuilderTool toolService)
        {
            _adminService= adminService;
            _toolService = toolService;
        }

        [HttpGet,Log(LogType =Common.EnumHelper.LogEnum.ADD)]
        public IActionResult Get()
        {
            return Ok(new {code=200 });
        }

        //[HttpGet]
        //public async Task<IActionResult> Get()
        //{
        //    var model = new Builder.Builder() { DbTableName = "sys_organize", ModelName = "SysOrganize", Namespace = "Sys" };
        //    await Task.Run(()=> _toolService.CreateModel(model));
        //    await Task.Run(()=> _toolService.CreateService(model));
        //    await Task.Run(() => _toolService.CreateApi(model));
        //    return Ok("Ok");
        //}

        

    }
}
